/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						       t_battlefield_preset_map_cache_data.cpp

	$Header: /game/t_battlefield_preset_map_cache_data.cpp $

	$NoKeywords: $

 ************************************************************************/

// kill the 255+ character identifier warning.  Templates tend to exceed that easily.
#include "precompiled.h"
#include "precompiled.h"
#pragma warning( disable: 4786 )

#include "battlefield_preset_map_cache.h"

#include "abstract_resource_cache.h"
#include "battlefield_preset_map.h"
#include "battlefield_preset_map_in_game.h"
#include "battlefield_preset_map_cache_data.h"

// ----------------------------------------------------------
// cache data for a preset battlefield
// ----------------------------------------------------------
char const * t_battlefield_preset_map_cache_data::get_prefix() const
{
	return t_resource_traits< t_battlefield_preset_map >::prefix;
}

// ----------------------------------------------------------
// ----------------------------------------------------------
t_battlefield_preset_map_in_game* t_battlefield_preset_map_cache_data::do_read( std::streambuf & stream,
												    t_progress_handler* handler )
{
	t_battlefield_preset_map_in_game*	result = 0;
	t_battlefield_preset_map			source;

	if ( source.read( stream ))
		result = new t_battlefield_preset_map_in_game( source );

	return result;
}

// ----------------------------------------------------------
// ----------------------------------------------------------
t_battlefield_preset_map_cache::t_battlefield_preset_map_cache( std::string const & name)
		            : t_abstract_cache<t_battlefield_preset_map_in_game>( 0 )
{
	set( new t_battlefield_preset_map_cache_data( name ) );
}

